Block Vector Predictor Refinement based on Reference Region Boundary

ABSTRACT

An apparatus determines a value of a coordinate for a sample is outside a range of values of the coordinate for samples in a reference region. The sample is displaced relative to a current block by an amount indicated by a block vector predictor (BVP). The apparatus adjusts a component, corresponding to a direction of the coordinate, of the BVP to have an adjusted value closer to the range of values of the coordinate for the samples in the reference region based on the determining. The apparatus uses the BVP, with the component adjusted to have the adjusted value, to determine or predict a block vector (BV) for the current block.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims the benefit of U.S. Provisional Application No.63/249,525, filed Sep. 28, 2021, which is hereby incorporated byreference in its entirety.

BRIEF DESCRIPTION OF THE DRAWINGS

Examples of several of the various embodiments of the present disclosureare described herein with reference to the drawings.

FIG. 1 illustrates an exemplary video coding/decoding system in whichembodiments of the present disclosure may be implemented.

FIG. 2 illustrates an exemplary encoder in which embodiments of thepresent disclosure may be implemented.

FIG. 3 illustrates an exemplary decoder in which embodiments of thepresent disclosure may be implemented.

FIG. 4 illustrates an example quadtree partitioning of a coding treeblock (CTB) in accordance with embodiments of the present disclosure.

FIG. 5 illustrates a corresponding quadtree of the example quadtreepartitioning of the CTB in FIG. 4 in accordance with embodiments of thepresent disclosure.

FIG. 6 illustrates example binary and ternary tree partitions inaccordance with embodiments of the present disclosure.

FIG. 7 illustrates an example quadtree+multi-type tree partitioning of aCTB in accordance with embodiments of the present disclosure.

FIG. 8 illustrates a corresponding quadtree+multi-type tree of theexample quadtree+multi-type tree partitioning of the CTB in FIG. 7 inaccordance with embodiments of the present disclosure.

FIG. 9 illustrates an example set of reference samples determined forintra prediction of a current block being encoded or decoded inaccordance with embodiments of the present disclosure.

FIG. 10A illustrates the 35 intra prediction modes supported by HEVC inaccordance with embodiments of the present disclosure.

FIG. 10B illustrates the 67 intra prediction modes supported by HEVC inaccordance with embodiments of the present disclosure.

FIG. 11 illustrates the current block and reference samples from FIG. 9in a two-dimensional x, y plane in accordance with embodiments of thepresent disclosure.

FIG. 12 illustrates an example angular mode prediction of the currentblock from FIG. 9 in accordance with embodiments of the presentdisclosure.

FIG. 13A illustrates an example of inter prediction performed for acurrent block in a current picture being encoded in accordance withembodiments of the present disclosure.

FIG. 13B illustrates an example horizontal component and verticalcomponent of a motion vector in accordance with embodiments of thepresent disclosure.

FIG. 14 illustrates an example of bi-prediction, performed for a currentblock in accordance with embodiments of the present disclosure.

FIG. 15A illustrates an example location of five spatial candidateneighboring blocks relative to a current block being coded in accordancewith embodiments of the present disclosure.

FIG. 15B illustrates an example location of two temporal, co-locatedblocks relative to a current block being coded in accordance withembodiments of the present disclosure.

FIG. 16 illustrates an example of IBC applied for screen content inaccordance with embodiments of the present disclosure.

FIG. 17 illustrates an example IBC coding in accordance with embodimentsof the present disclosure.

FIG. 18 illustrates an adjustment to a BVP in accordance withembodiments of the present disclosure.

FIG. 19 illustrates another adjustment to a BVP in accordance withembodiments of the present disclosure.

FIG. 20 illustrates another adjustment to a BVP in accordance withembodiments of the present disclosure.

FIG. 21A illustrates an example IBC reference region determined based onan IBC reference sample memory size of 128×128 samples and a CTU size of128×128 samples in accordance with embodiments of the presentdisclosure.

FIG. 21B illustrates another example IBC reference region determinedbased on an IBC reference sample memory size of 128×128 samples and aCTU size of 128×128 samples in accordance with embodiments of thepresent disclosure.

FIG. 22A an adjustment to a BVP in accordance with embodiments of thepresent disclosure.

FIG. 22B another adjustment to a BVP in accordance with embodiments ofthe present disclosure.

FIG. 23A an adjustment to a BVP in accordance with embodiments of thepresent disclosure.

FIG. 23B another adjustment to a BVP in accordance with embodiments ofthe present disclosure.

FIG. 24 illustrates a flowchart of a method for adjusting a component ofa BVP in accordance with embodiments of the present disclosure.

FIG. 25 illustrates a block diagram of an example computer system inwhich embodiments of the present disclosure may be implemented.

DETAILED DESCRIPTION

In the following description, numerous specific details are set forth inorder to provide a thorough understanding of the disclosure. However, itwill be apparent to those skilled in the art that the disclosure,including structures, systems, and methods, may be practiced withoutthese specific details. The description and representation herein arethe common means used by those experienced or skilled in the art to mosteffectively convey the substance of their work to others skilled in theart. In other instances, well-known methods, procedures, components, andcircuitry have not been described in detail to avoid unnecessarilyobscuring aspects of the disclosure.

References in the specification to “one embodiment,” “an embodiment,”“an example embodiment,” etc., indicate that the embodiment describedmay include a particular feature, structure, or characteristic, butevery embodiment may not necessarily include the particular feature,structure, or characteristic. Moreover, such phrases are not necessarilyreferring to the same embodiment. Further, when a particular feature,structure, or characteristic is described in connection with anembodiment, it is submitted that it is within the knowledge of oneskilled in the art to affect such feature, structure, or characteristicin connection with other embodiments whether or not explicitlydescribed.

Also, it is noted that individual embodiments may be described as aprocess which is depicted as a flowchart, a flow diagram, a data flowdiagram, a structure diagram, or a block diagram. Although a flowchartmay describe the operations as a sequential process, many of theoperations can be performed in parallel or concurrently. In addition,the order of the operations may be re-arranged. A process is terminatedwhen its operations are completed, but could have additional steps notincluded in a figure. A process may correspond to a method, a function,a procedure, a subroutine, a subprogram, etc. When a process correspondsto a function, its termination can correspond to a return of thefunction to the calling function or the main function.

The term “computer-readable medium” includes, but is not limited to,portable or non-portable storage devices, optical storage devices, andvarious other mediums capable of storing, containing, or carryinginstruction(s) and/or data. A computer-readable medium may include anon-transitory medium in which data can be stored and that does notinclude carrier waves and/or transitory electronic signals propagatingwirelessly or over wired connections. Examples of a non-transitorymedium may include, but are not limited to, a magnetic disk or tape,optical storage media such as compact disk (CD) or digital versatiledisk (DVD), flash memory, memory or memory devices. A computer-readablemedium may have stored thereon code and/or machine-executableinstructions that may represent a procedure, a function, a subprogram, aprogram, a routine, a subroutine, a module, a software package, a class,or any combination of instructions, data structures, or programstatements. A code segment may be coupled to another code segment or ahardware circuit by passing and/or receiving information, data,arguments, parameters, or memory contents. Information, arguments,parameters, data, etc. may be passed, forwarded, or transmitted via anysuitable means including memory sharing, message passing, token passing,network transmission, or the like.

Furthermore, embodiments may be implemented by hardware, software,firmware, middleware, microcode, hardware description languages, or anycombination thereof. When implemented in software, firmware, middlewareor microcode, the program code or code segments to perform the necessarytasks (e.g., a computer-program product) may be stored in acomputer-readable or machine-readable medium. A processor(s) may performthe necessary tasks.

Representing a video sequence in digital form may require a large numberof bits. The data size of a video sequence in digital form may be toolarge for storage and/or transmission in many applications. Videoencoding may be used to compress the size of a video sequence to providefor more efficient storage and/or transmission. Video decoding may beused to decompress a compressed video sequence for display and/or otherforms of consumption.

FIG. 1 illustrates an exemplary video coding/decoding system 100 inwhich embodiments of the present disclosure may be implemented. Videocoding/decoding system 100 comprises a source device 102, a transmissionmedium 104, and a destination device 106. Source device 102 encodes avideo sequence 108 into a bitstream 110 for more efficient storageand/or transmission. Source device 102 may store and/or transmitbitstream 110 to destination device 106 via transmission medium 104.Destination device 106 decodes bitstream 110 to display video sequence108. Destination device 106 may receive bitstream 110 from source device102 via transmission medium 104. Source device 102 and destinationdevice 106 may be any one of a number of different devices, including adesktop computer, laptop computer, tablet computer, smart phone,wearable device, television, camera, video gaming console, set-top box,or video streaming device.

To encode video sequence 108 into bitstream 110, source device 102 maycomprise a video source 112, an encoder 114, and an output interface116. Video source 112 may provide or generate video sequence 108 from acapture of a natural scene and/or a synthetically generated scene. Asynthetically generated scene may be a scene comprising computergenerated graphics or screen content. Video source 112 may comprise avideo capture device (e.g., a video camera), a video archive comprisingpreviously captured natural scenes and/or synthetically generatedscenes, a video feed interface to receive captured natural scenes and/orsynthetically generated scenes from a video content provider, and/or aprocessor to generate synthetic scenes.

A shown in FIG. 1 , a video sequence, such as video sequence 108, maycomprise a series of pictures (also referred to as frames). A videosequence may achieve the impression of motion when a constant orvariable time is used to successively present pictures of the videosequence. A picture may comprise one or more sample arrays of intensityvalues. The intensity values may be taken at a series of regularlyspaced locations within a picture. A color picture typically comprises aluminance sample array and two chrominance sample arrays. The luminancesample array may comprise intensity values representing the brightness(or luma component, Y) of a picture. The chrominance sample arrays maycomprise intensity values that respectively represent the blue and redcomponents of a picture (or chroma components, Cb and Cr) separate fromthe brightness. Other color picture sample arrays are possible based ondifferent color schemes (e.g., an RGB color scheme). For color pictures,a pixel may refer to all three intensity values for a given location inthe three sample arrays used to represent color pictures. A monochromepicture comprises a single, luminance sample array. For monochromepictures, a pixel may refer to the intensity value at a given locationin the single, luminance sample array used to represent monochromepictures.

Encoder 114 may encode video sequence 108 into bitstream 110. To encodevideo sequence 108, encoder 114 may apply one or more predictiontechniques to reduce redundant information in video sequence 108.Redundant information is information that may be predicted at a decoderand therefore may not be needed to be transmitted to the decoder foraccurate decoding of the video sequence. For example, encoder 114 mayapply spatial prediction (e.g., intra-frame or intra prediction),temporal prediction (e.g., inter-frame prediction or inter prediction),inter-layer prediction, and/or other prediction techniques to reduceredundant information in video sequence 108. Before applying the one ormore prediction techniques, encoder 114 may partition pictures of videosequence 108 into rectangular regions referred to as blocks. Encoder 114may then encode a block using one or more of the prediction techniques.

For temporal prediction, encoder 114 may search for a block similar tothe block being encoded in another picture (also referred to as areference picture) of video sequence 108. The block determined duringthe search (also referred to as a prediction block) may then be used topredict the block being encoded. For spatial prediction, encoder 114 mayform a prediction block based on data from reconstructed neighboringsamples of the block to be encoded within the same picture of videosequence 108. A reconstructed sample refers to a sample that was encodedand then decoded. Encoder 114 may determine a prediction error (alsoreferred to as a residual) based on the difference between a block beingencoded and a prediction block. The prediction error may representnon-redundant information that may be transmitted to a decoder foraccurate decoding of a video sequence.

Encoder 114 may apply a transform to the prediction error (e.g. adiscrete cosine transform (DCT)) to generate transform coefficients.Encoder 114 may form bitstream 110 based on the transform coefficientsand other information used to determine prediction blocks (e.g.,prediction types, motion vectors, and prediction modes). In someexamples, encoder 114 may perform one or more of quantization andentropy coding of the transform coefficients and/or the otherinformation used to determine prediction blocks before forming bitstream110 to further reduce the number of bits needed to store and/or transmitvideo sequence 108.

Output interface 116 may be configured to write and/or store bitstream110 onto transmission medium 104 for transmission to destination device106. In addition or alternatively, output interface 116 may beconfigured to transmit, upload, and/or stream bitstream 110 todestination device 106 via transmission medium 104. Output interface 116may comprise a wired and/or wireless transmitter configured to transmit,upload, and/or stream bitstream 110 according to one or more proprietaryand/or standardized communication protocols, such as Digital VideoBroadcasting (DVB) standards, Advanced Television Systems Committee(ATSC) standards, Integrated Services Digital Broadcasting (ISDB)standards, Data Over Cable Service Interface Specification (DOCSIS)standards, 3rd Generation Partnership Project (3GPP) standards,Institute of Electrical and Electronics Engineers (IEEE) standards,Internet Protocol (IP) standards, and Wireless Application Protocol(WAP) standards.

Transmission medium 104 may comprise a wireless, wired, and/or computerreadable medium. For example, transmission medium 104 may comprise oneor more wires, cables, air interfaces, optical discs, flash memory,and/or magnetic memory. In addition or alternatively, transmissionmedium 104 may comprise one more networks (e.g., the Internet) or fileservers configured to store and/or transmit encoded video data.

To decode bitstream 110 into video sequence 108 for display, destinationdevice 106 may comprise an input interface 118, a decoder 120, and avideo display 122. Input interface 118 may be configured to readbitstream 110 stored on transmission medium 104 by source device 102. Inaddition or alternatively, input interface 118 may be configured toreceive, download, and/or stream bitstream 110 from source device 102via transmission medium 104. Input interface 118 may comprise a wiredand/or wireless receiver configured to receive, download, and/or streambitstream 110 according to one or more proprietary and/or standardizedcommunication protocols, such as those mentioned above.

Decoder 120 may decode video sequence 108 from encoded bitstream 110. Todecode video sequence 108, decoder 120 may generate prediction blocksfor pictures of video sequence 108 in a similar manner as encoder 114and determine prediction errors for the blocks. Decoder 120 may generatethe prediction blocks using prediction types, prediction modes, and/ormotion vectors received in bitstream 110 and determine the predictionerrors using transform coefficients also received in bitstream 110.Decoder 120 may determine the prediction errors by weighting transformbasis functions using the transform coefficients. Decoder 120 maycombine the prediction blocks and prediction errors to decode videosequence 108. In some examples, decoder 120 may decode a video sequencethat approximates video sequence 108 due to, for example, lossycompression of video sequence 108 by encoder 114 and/or errorsintroduced into encoded bitstream 110 during transmission to destinationdevice 106.

Video display 122 may display video sequence 108 to a user. Videodisplay 122 may comprise a cathode rate tube (CRT) display, liquidcrystal display (LCD), a plasma display, light emitting diode (LED)display, or any other display device suitable for displaying videosequence 108.

It should be noted that video encoding/decoding system 100 is presentedby way of example and not limitation. In the example of FIG. 1 , videoencoding/decoding system 100 may have other components and/orarrangements. For example, video source 112 may be external to sourcedevice 102. Similarly, video display device 122 may be external todestination device 106 or omitted altogether where video sequence isintended for consumption by a machine and/or storage device. In anotherexample, source device 102 may further comprise a video decoder anddestination device 104 may comprise a video encoder. In such an example,source device 102 may be configured to further receive an encoded bitstream from destination device 106 to support two-way video transmissionbetween the devices.

In the example of FIG. 1 , encoder 114 and decoder 120 may operateaccording to any one of a number of proprietary or industry video codingstandards. For example, encoder 114 and decoder 120 may operateaccording to one or more of International Telecommunications UnionTelecommunication Standardization Sector (ITU-T) H.263, ITU-T H.264 andMoving Picture Expert Group (MPEG)-4 Visual (also known as AdvancedVideo Coding (AVC)), ITU-T H.265 and MPEG-H Part 2 (also known as HighEfficiency Video Coding (HEVC), ITU-T H.265 and MPEG-I Part 3 (alsoknown as Versatile Video Coding (VVC)), the WebM VP8 and VP9 codecs, andAOMedia Video 1 (AV1).

FIG. 2 illustrates an exemplary encoder 200 in which embodiments of thepresent disclosure may be implemented. Encoder 200 encodes a videosequence 202 into a bitstream 204 for more efficient storage and/ortransmission. Encoder 200 may be implemented in video coding/decodingsystem 100 in FIG. 1 or in any one of a number of different devices,including a desktop computer, laptop computer, tablet computer, smartphone, wearable device, television, camera, video gaming console,set-top box, or video streaming device. Encoder 200 comprises an interprediction unit 206, an intra prediction unit 208, combiners 210 and212, a transform and quantization unit (TR+Q) unit 214, an inversetransform and quantization unit (iTR+iQ) 216, entropy coding unit 218,one or more filters 220, and a buffer 222.

Encoder 200 may partition the pictures of video sequence 202 into blocksand encode video sequence 202 on a block-by-block basis. Encoder 200 mayperform a prediction technique on a block being encoded using eitherinter prediction unit 206 or intra prediction unit 208. Inter predictionunit 206 may perform inter prediction by searching for a block similarto the block being encoded in another, reconstructed picture (alsoreferred to as a reference picture) of video sequence 202. Areconstructed picture refers to a picture that was encoded and thendecoded. The block determined during the search (also referred to as aprediction block) may then be used to predict the block being encoded toremove redundant information. Inter prediction unit 206 may exploittemporal redundancy or similarities in scene content from picture topicture in video sequence 202 to determine the prediction block. Forexample, scene content between pictures of video sequence 202 may besimilar except for differences due to motion or affine transformation ofthe screen content over time.

Intra prediction unit 208 may perform intra prediction by forming aprediction block based on data from reconstructed neighboring samples ofthe block to be encoded within the same picture of video sequence 202. Areconstructed sample refers to a sample that was encoded and thendecoded. Intra prediction unit 208 may exploit spatial redundancy orsimilarities in scene content within a picture of video sequence 202 todetermine the prediction block. For example, the texture of a region ofscene content in a picture may be similar to the texture in theimmediate surrounding area of the region of the scene content in thesame picture.

After prediction, combiner 210 may determine a prediction error (alsoreferred to as a residual) based on the difference between the blockbeing encoded and the prediction block. The prediction error mayrepresent non-redundant information that may be transmitted to a decoderfor accurate decoding of a video sequence.

Transform and quantization unit 214 may transform and quantize theprediction error. Transform and quantization unit 214 may transform theprediction error into transform coefficients by applying, for example, aDCT to reduce correlated information in the prediction error. Transformand quantization unit 214 may quantize the coefficients by mapping dataof the transform coefficients to a predefined set of representativevalues. Transform and quantization unit 214 may quantize thecoefficients to reduce irrelevant information in bitstream 204.Irrelevant information is information that may be removed from thecoefficients without producing visible and/or perceptible distortion invideo sequence 202 after decoding.

Entropy coding unit 218 may apply one or more entropy coding methods tothe quantized transform coefficients to further reduce the bit rate. Forexample, entropy coding unit 218 may apply context adaptive variablelength coding (CAVLC), context adaptive binary arithmetic coding(CABAC), and syntax-based context-based binary arithmetic coding (SBAC).The entropy coded coefficients are packed to form bitstream 204.

Inverse transform and quantization unit 216 may inverse quantize andinverse transform the quantized transform coefficients to determine areconstructed prediction error. Combiner 212 may combine thereconstructed prediction error with the prediction block to form areconstructed block. Filter(s) 220 may filter the reconstructed blockusing, for example, a deblocking filter and/or a sample-adaptive offset(SAO) filter. Buffer 222 may store the reconstructed block forprediction of one or more other blocks in the same and/or differentpicture of video sequence 202.

Although not shown in FIG. 2 , encoder 200 further comprises an encodercontrol unit configured to control one or more of the units of encoder200 shown in FIG. 2 . The encoder control unit may control the one ormore units of encoder 200 such that bitstream 204 is generated inconformance with the requirements of any one of a number of proprietaryor industry video coding standards. For example, The encoder controlunit may control the one or more units of encoder 200 such thatbitstream 204 is generated in conformance with one or more of ITU-TH.263, AVC, HEVC, VVC, VP8, VP9, and AV1 video coding standards.

Within the constraints of a proprietary or industry video codingstandard, the encoder control unit may attempt to minimize or reduce thebitrate of bitstream 204 and maximize or increase the reconstructedvideo quality. For example, the encoder control unit may attempt tominimize or reduce the bitrate of bitstream 204 given a level that thereconstructed video quality may not fall below, or attempt to maximizeor increase the reconstructed video quality given a level that the bitrate of bitstream 204 may not exceed. The encoder control unit maydetermine/control one or more of: partitioning of the pictures of videosequence 202 into blocks, whether a block is inter predicted by interprediction unit 206 or intra predicted by intra prediction unit 208, amotion vector for inter prediction of a block, an intra prediction modeamong a plurality of intra prediction modes for intra prediction of ablock, filtering performed by filter(s) 220, and one or more transformtypes and/or quantization parameters applied by transform andquantization unit 214. The encoder control unit may determine/controlthe above based on how the determination/control effects arate-distortion measure for a block or picture being encoded. Theencoder control unit may determine/control the above to reduce therate-distortion measure for a block or picture being encoded.

After being determined, the prediction type used to encode a block(intra or inter prediction), prediction information of the block (intraprediction mode if intra predicted, motion vector, etc.), and transformand quantization parameters, may be sent to entropy coding unit 218 tobe further compressed to reduce the bit rate. The prediction type,prediction information, and transform and quantization parameters may bepacked with the prediction error to form bitstream 204.

It should be noted that encoder 200 is presented by way of example andnot limitation. In other examples, encoder 200 may have other componentsand/or arrangements. For example, one or more of the components shown inFIG. 2 may be optionally included in encoder 200, such as entropy codingunit 218 and filters(s) 220.

FIG. 3 illustrates an exemplary decoder 300 in which embodiments of thepresent disclosure may be implemented. Decoder 300 decodes an bitstream302 into a decoded video sequence for display and/or some other form ofconsumption. Decoder 300 may be implemented in video coding/decodingsystem 100 in FIG. 1 or in any one of a number of different devices,including a desktop computer, laptop computer, tablet computer, smartphone, wearable device, television, camera, video gaming console,set-top box, or video streaming device. Decoder 300 comprises an entropydecoding unit 306, an inverse transform and quantization (iTR+iQ) unit308, a combiner 310, one or more filters 312, a buffer 314, an interprediction unit 316, and an intra prediction unit 318.

Although not shown in FIG. 3 , decoder 300 further comprises a decodercontrol unit configured to control one or more of the units of decoder300 shown in FIG. 3 . The decoder control unit may control the one ormore units of decoder 300 such that bitstream 302 is decoded inconformance with the requirements of any one of a number of proprietaryor industry video coding standards. For example, The decoder controlunit may control the one or more units of decoder 300 such thatbitstream 302 is decoded in conformance with one or more of ITU-T H.263,AVC, HEVC, VVC, VP8, VP9, and AV1 video coding standards.

The decoder control unit may determine/control one or more of: whether ablock is inter predicted by inter prediction unit 316 or intra predictedby intra prediction unit 318, a motion vector for inter prediction of ablock, an intra prediction mode among a plurality of intra predictionmodes for intra prediction of a block, filtering performed by filter(s)312, and one or more inverse transform types and/or inverse quantizationparameters to be applied by inverse transform and quantization unit 308.One or more of the control parameters used by the decoder control unitmay be packed in bitstream 302.

Entropy decoding unit 306 may entropy decode the bitstream 302. Inversetransform and quantization unit 308 may inverse quantize and inversetransform the quantized transform coefficients to determine a decodedprediction error. Combiner 310 may combine the decoded prediction errorwith a prediction block to form a decoded block. The prediction blockmay be generated by inter prediction unit 318 or inter prediction unit316 as described above with respect to encoder 200 in FIG. 2 . Filter(s)312 may filter the decoded block using, for example, a deblocking filterand/or a sample-adaptive offset (SAO) filter. Buffer 314 may store thedecoded block for prediction of one or more other blocks in the sameand/or different picture of the video sequence in bitstream 302. Decodedvideo sequence 304 may be output from filter(s) 312 as shown in FIG. 3 .

It should be noted that decoder 300 is presented by way of example andnot limitation. In other examples, decoder 300 may have other componentsand/or arrangements. For example, one or more of the components shown inFIG. 3 may be optionally included in decoder 300, such as entropydecoding unit 306 and filters(s) 312.

It should be further noted that, although not shown in FIGS. 2 and 3 ,each of encoder 200 and decoder 300 may further comprise an intra blockcopy unit in addition to inter prediction and intra prediction units.The intra block copy unit may perform similar to an inter predictionunit but predict blocks within the same picture. For example, the intrablock copy unit may exploit repeated patterns that appear in screencontent. Screen content may include, for example, computer generatedtext, graphics, and animation.

As mentioned above, video encoding and decoding may be performed on ablock-by-block basis. The process of partitioning a picture into blocksmay be adaptive based on the content of the picture. For example, largerblock partitions may be used in areas of a picture with higher levels ofhomogeneity to improve coding efficiency.

In HEVC, a picture may be partitioned into non-overlapping squareblocks, referred to as coding tree blocks (CTBs), comprising samples ofa sample array. A CTB may have a size of 2^(n)×2^(n) samples, where nmay be specified by a parameter of the encoding system. For example, nmay be 4, 5, or 6. A CTB may be further partitioned by a recursivequadtree partitioning into coding blocks (CBs) of half vertical and halfhorizontal size. The CTB forms the root of the quadtree. A CB that isnot split further as part of the recursive quadtree partitioning may bereferred to as a leaf-CB of the quadtree and otherwise as a non-leaf CBof the quadtree. A CB may have a minimum size specified by a parameterof the encoding system. For example, a CB may have a minimum size of4×4, 8×8, 16×16, 32×32, or 64×64 samples. For inter and intraprediction, a CB may be further partitioned into one or more predictionblocks (PBs) for performing inter and intra prediction. A PB may be arectangular block of samples on which the same prediction type/mode maybe applied. For transformations, a CB may be partitioned into one ormore transform blocks (TBs). A TB may be a rectangular block of samplesthat may determine an applied transform size.

FIG. 4 illustrates an example quadtree partitioning of a CTB 400. FIG. 5illustrates a corresponding quadtree 500 of the example quadtreepartitioning of CTB 400 in FIG. 4 . As shown in FIGS. 4 and 5 , CTB 400is first partitioned into four CBs of half vertical and half horizontalsize. Three of the resulting CBs of the first level partitioning of CTB400 are leaf-CBs. The three leaf CBs of the first level partitioning ofCTB 400 are respectively labeled 7, 8, and 9 in FIGS. 4 and 5 . Thenon-leaf CB of the first level partitioning of CTB 400 is partitionedinto four sub-CBs of half vertical and half horizontal size. Three ofthe resulting sub-CBs of the second level partitioning of CTB 400 areleaf CBs. The three leaf CBs of the second level partitioning of CTB 400are respectively labeled 0, 5, and 6 in FIGS. 4 and 5 . Finally, thenon-leaf CB of the second level partitioning of CTB 400 is partitionedinto four leaf CBs of half vertical and half horizontal size. The fourleaf CBs are respectively labeled 1, 2, 3, and 4 in FIGS. 4 and 5 .

Altogether, CTB 400 is partitioned into 10 leaf CBs respectively labeled0-9. The resulting quadtree partitioning of CTB 400 may be scanned usinga z-scan (left-to-right, top-to-bottom) to form the sequence order forencoding/decoding the CB leaf nodes. The numeric label of each CB leafnode in FIGS. 4 and 5 may correspond to the sequence order forencoding/decoding, with CB leaf node 0 encoded/decoded first and CB leafnode 9 encoded/decoded last. Although not shown in FIGS. 4 and 5 , itshould be noted that each CB leaf node may comprise one or more PBs andTBs.

In VVC, a picture may be partitioned in a similar manner as in HEVC. Apicture may be first partitioned into non-overlapping square CTB s. TheCTBs may then be partitioned by a recursive quadtree partitioning intoCBs of half vertical and half horizontal size. In VVC, a quadtree leafnode may be further partitioned by a binary tree or ternary treepartitioning into CBs of unequal sizes. FIG. 6 illustrates examplebinary and ternary tree partitions. A binary tree partition may divide aparent block in half in either the vertical direction 602 or horizontaldirection 604. The resulting partitions may be half in size as comparedto the parent block. A ternary tree partition may divide a parent blockinto three parts in either the vertical direction 606 or horizontaldirection 608. The middle partition may be twice as large as the othertwo end partitions in a ternary tree partition.

Because of the addition of binary and ternary tree partitioning, in VVCthe block partitioning strategy may be referred to asquadtree+multi-type tree partitioning. FIG. 7 illustrates an examplequadtree+multi-type tree partitioning of a CTB 700. FIG. 8 illustrates acorresponding quadtree+multi-type tree 800 of the examplequadtree+multi-type tree partitioning of CTB 700 in FIG. 7 . In bothFIGS. 7 and 8 , quadtree splits are shown in solid lines and multi-typetree splits are shown in dashed lines. For ease of explanation, CTB 700is shown with the same quadtree partitioning as CTB 400 described inFIG. 4 . Therefore, description of the quadtree partitioning of CTB 700is omitted. The description of the additional multi-type tree partitionsof CTB 700 is made relative to three leaf-CBs shown in FIG. 4 that havebeen further partitioned using one or more binary and ternary treepartitions. The three leaf-CBs in FIG. 4 that are shown in FIG. 7 asbeing further partitioned are leaf-CBs 5, 8, and 9.

Starting with leaf-CB 5 in FIG. 4 , FIG. 7 shows this leaf-CBpartitioned into two CBs based on a vertical binary tree partitioning.The two resulting CBs are leaf-CBs respectively labeled 5 and 6 in FIGS.7 and 8 . With respect to leaf-CB 8 in FIG. 4 , FIG. 7 shows thisleaf-CB partitioned into three CBs based on a vertical ternary treepartition. Two of the three resulting CBs are leaf-CBs respectivelylabeled 9 and 14 in FIGS. 7 and 8 . The remaining, non-leaf CB ispartitioned first into two CBs based on a horizontal binary treepartition, one of which is a leaf-CB labeled 10 and the other of whichis further partitioned into three CBs based on a vertical ternary treepartition. The resulting three CBs are leaf-CBs respectively labeled 11,12, and 13 in FIGS. 7 and 8 . Finally, with respect to leaf-CB 9 in FIG.4 , FIG. 7 shows this leaf-CB partitioned into three CBs based on ahorizontal ternary tree partition. Two of the three CBs are leaf-CBsrespectively labeled 15 and 19 in FIGS. 7 and 8 . The remaining,non-leaf CB is partitioned into three CBs based on another horizontalternary tree partition. The resulting three CBs are all leaf-CBsrespectively labeled 16, 17, and 18 in FIGS. 7 and 8 .

Altogether, CTB 700 is partitioned into 20 leaf CBs respectively labeled0-19. The resulting quadtree+multi-type tree partitioning of CTB 700 maybe scanned using a z-scan (left-to-right, top-to-bottom) to form thesequence order for encoding/decoding the CB leaf nodes. The numericlabel of each CB leaf node in FIGS. 7 and 8 may correspond to thesequence order for encoding/decoding, with CB leaf node 0encoded/decoded first and CB leaf node 19 encoded/decoded last. Althoughnot shown in FIGS. 7 and 8 , it should be noted that each CB leaf nodemay comprise one or more PBs and TBs.

In addition to specifying various blocks (e.g., CTB, CB, PB, TB), HEVCand VVC further define various units. While blocks may comprise arectangular area of samples in a sample array, units may comprise thecollocated blocks of samples from the different sample arrays (e.g.,luma and chroma sample arrays) that form a picture as well as syntaxelements and prediction data of the blocks. A coding tree unit (CTU) maycomprise the collocated CTBs of the different sample arrays and may forma complete entity in an encoded bit stream. A coding unit (CU) maycomprise the collocated CBs of the different sample arrays and syntaxstructures used to code the samples of the CBs. A prediction unit (PU)may comprise the collocated PBs of the different sample arrays andsyntax elements used to predict the PBs. A transform unit (TU) maycomprise TBs of the different samples arrays and syntax elements used totransform the TBs.

It should be noted that the term block may be used to refer to any of aCTB, CB, PB, TB, CTU, CU, PU, or TU in the context of HEVC and VVC. Itshould be further noted that the term block may be used to refer tosimilar data structures in the context of other video coding standards.For example, the term block may refer to a macroblock in AVC, amacroblock or sub-block in VP8, a superblock or sub-block in VP9, or asuperblock or sub-block in AV1.

In intra prediction, samples of a block to be encoded (also referred toas the current block) may be predicted from samples of the columnimmediately adjacent to the left-most column of the current block andsamples of the row immediately adjacent to the top-most row of thecurrent block. The samples from the immediately adjacent column and rowmay be jointly referred to as reference samples. Each sample of thecurrent block may be predicted by projecting the position of the samplein the current block in a given direction (also referred to as an intraprediction mode) to a point along the reference samples. The sample maybe predicted by interpolating between the two closest reference samplesof the projection point if the projection does not fall directly on areference sample. A prediction error (also referred to as a residual)may be determined for the current block based on differences between thepredicted sample values and the original sample values of the currentblock.

At an encoder, this process of predicting samples and determining aprediction error based on a difference between the predicted samples andoriginal samples may be performed for a plurality of different intraprediction modes, including non-directional intra prediction modes. Theencoder may select one of the plurality of intra prediction modes andits corresponding prediction error to encode the current block. Theencoder may send an indication of the selected prediction mode and itscorresponding prediction error to a decoder for decoding of the currentblock. The decoder may decode the current block by predicting thesamples of the current block using the intra prediction mode indicatedby the encoder and combining the predicted samples with the predictionerror.

FIG. 9 illustrates an example set of reference samples 902 determinedfor intra prediction of a current block 904 being encoded or decoded. InFIG. 9 , current block 904 corresponds to block 3 of partitioned CTB 700in FIG. 7 . As explained above, the numeric labels 0-19 of the blocks ofpartitioned CTB 700 may correspond to the sequence order forencoding/decoding the blocks and are used as such in the example of FIG.9 .

Given current block 904 is of w×h samples in size, reference samples 902may extend over 2w samples of the row immediately adjacent to thetop-most row of current block 904, 2h samples of the column immediatelyadjacent to the left-most column of current block 904, and the top leftneighboring corner sample to current block 904. In the example of FIG. 9, current block 904 is square, so w=h=s. For constructing the set ofreference samples 902, available samples from neighboring blocks ofcurrent block 904 may be used. Samples may not be available forconstructing the set of reference samples 902 if, for example, thesamples would lie outside the picture of the current block, the samplesare part of a different slice of the current block (where the concept ofslices are used), and/or the samples belong to blocks that have beeninter coded and constrained intra prediction is indicated. Whenconstrained intra prediction is indicated, intra prediction may not bedependent on inter predicted blocks.

In addition to the above, samples that may not be available forconstructing the set of reference samples 902 include samples in blocksthat have not already been encoded and reconstructed at an encoder ordecoded at a decoder based on the sequence order for encoding/decoding.This restriction may allow identical prediction results to be determinedat both the encoder and decoder. In FIG. 9 , samples from neighboringblocks 0, 1, and 2 may be available to construct reference samples 902given that these blocks are encoded and reconstructed at an encoder anddecoded at a decoder prior to coding of current block 904. This assumesthere are no other issues, such as those mentioned above, preventing theavailability of samples from neighboring blocks 0, 1, and 2. However,the portion of reference samples 902 from neighboring block 6 may not beavailable due to the sequence order for encoding/decoding.

Unavailable ones of reference samples 902 may be filled with availableones of reference samples 902. For example, an unavailable referencesample may be filled with a nearest available reference sampledetermined by moving in a clock-wise direction through reference samples902 from the position of the unavailable reference. If no referencesamples are available, reference samples 902 may be filled with themid-value of the dynamic range of the picture being coded.

It should be noted that reference samples 902 may be filtered based onthe size of current block 904 being coded and an applied intraprediction mode. It should be further noted that FIG. 9 illustrates onlyone exemplary determination of reference samples for intra prediction ofa block. In some proprietary and industry video coding standards,reference samples may be determined in a different manner than discussedabove. For example, multiple reference lines may be used in otherinstances, such as used in VVC.

After reference samples 902 are determined and optionally filtered,samples of current block 904 may be intra predicted based on referencesamples 902. Most encoders/decoders support a plurality of intraprediction modes in accordance with one or more video coding standards.For example, HEVC supports 35 intra prediction modes, including a planarmode, a DC mode, and 33 angular modes. VVC supports 67 intra predictionmodes, including a planar mode, a DC mode, and 65 angular modes. Planarand DC modes may be used to predict smooth and gradually changingregions of a picture. Angular modes may be used to predict directionalstructures in regions of a picture.

FIG. 10A illustrates the 35 intra prediction modes supported by HEVC.The 35 intra prediction modes are identified by indices 0 to 34.Prediction mode 0 corresponds to planar mode. Prediction mode 1corresponds to DC mode. Prediction modes 2-34 correspond to angularmodes. Prediction modes 2-18 may be referred to as horizontal predictionmodes because the principal source of prediction is in the horizontaldirection. Prediction modes 19-34 may be referred to as verticalprediction modes because the principal source of prediction is in thevertical direction.

FIG. 10B illustrates the 67 intra prediction modes supported by VVC. The67 intra prediction modes are identified by indices 0 to 66. Predictionmode 0 corresponds to planar mode. Prediction mode 1 corresponds to DCmode. Prediction modes 2-66 correspond to angular modes. Predictionmodes 2-34 may be referred to as horizontal prediction modes because theprincipal source of prediction is in the horizontal direction.Prediction modes 35-66 may be referred to as vertical prediction modesbecause the principal source of prediction is in the vertical direction.Because blocks in VVC may be non-square, some of the intra predictionmodes illustrated in FIG. 10B may be adaptively replaced by wide-angledirections.

To further describe the application of intra prediction modes todetermine a prediction of a current block, reference is made to FIGS. 11and 12 . In FIG. 11 , current block 904 and reference samples 902 fromFIG. 9 are shown in a two-dimensional x, y plane, where a sample may bereferenced as p [x][y]. In order to simplify the prediction process,reference samples 902 may be placed in two, one-dimensional arrays.Reference samples 902 above current block 904 may be placed in theone-dimensional array ref₁[x]:

ref₁[x]=p[−1+x][−1], (x≥0)  (1)

Reference samples 902 to the left of current block 904 may be placed inthe one-dimensional array ref₂[x]:

ref₂[y]=p[−1][−1+y], (y≥0)  (2)

For planar mode, a sample at location [x][y] in current block 904 may bepredicted by calculating the mean of two interpolated values. The firstof the two interpolated values may be based on a horizontal linearinterpolation at location [x][y] in current block 904. The second of thetwo interpolated values may be based on a vertical linear interpolationat location [x][y] in current block 904. The predicted sample p [x][y]in current block 904 may be calculated as

$\begin{matrix}{{{p\lbrack x\rbrack}\lbrack y\rbrack} = {\frac{1}{2 \cdot s}\left( {{{h\lbrack x\rbrack}\lbrack y\rbrack} + {{v\lbrack x\rbrack}\lbrack y\rbrack} + s} \right)}} & (3)\end{matrix}$ where $\begin{matrix}{{{h\lbrack x\rbrack}\lbrack y\rbrack} = {{\left( {s - x - 1} \right) \cdot {{ref}_{2}\lbrack y\rbrack}} + {\left( {x + 1} \right) \cdot {{ref}_{1}\lbrack s\rbrack}}}} & (4)\end{matrix}$

may be the horizontal linear interpolation at location [x][y] in currentblock 904 and

v[x][y]=(s−y−1)·ref₁[x]+(y+1)·ref₂[s]  (5)

may be the vertical linear interpolation at location [x][y] in currentblock 904.

For DC mode, a sample at location [x][y] in current block 904 may bepredicted by the mean of the reference samples 902. The predicted valuesample p [x][y] in current block 904 may be calculated as

$\begin{matrix}{{{p\lbrack x\rbrack}\lbrack y\rbrack} = {\frac{1}{2 \cdot s}\left( {{\sum\limits_{x = 0}^{s - 1}{{ref}_{1}\lbrack x\rbrack}} + {\sum\limits_{y = 0}^{s - 1}{{ref}_{2}\lbrack y\rbrack}}} \right)}} & (6)\end{matrix}$

For angular modes, a sample at location [x][y] in current block 904 maybe predicted by projecting the location [x][y] in a direction specifiedby a given angular mode to a point on the horizontal or vertical line ofsamples comprising reference samples 902. The sample at location [x][y]may be predicted by interpolating between the two closest referencesamples of the projection point if the projection does not fall directlyon a reference sample. The direction specified by the angular mode maybe given by an angle φ defined relative to the y-axis for verticalprediction modes (e.g., modes 19-34 in HEVC and modes 35-66 in VVC) andrelative to the x-axis for horizontal prediction modes (e.g., modes 2-18in HEVC and modes 2-34 in VVC).

FIG. 12 illustrates a prediction of a sample at location [x][y] incurrent block 904 for a vertical prediction mode 906 given by an angleφ. For vertical prediction modes, the location [x][y] in current block904 is projected to a point (referred to herein as the “projectionpoint”) on the horizontal line of reference samples ref₁[x]. Referencesamples 902 are only partially shown in FIG. 12 for ease ofillustration. Because the projection point falls at a fractional sampleposition between two reference samples in the example of FIG. 12 , thepredicted sample p [x][y] in current block 904 may be calculated bylinearly interpolating between the two reference samples as follows

p[x][y]=(1−i _(f))·ref₁[x+i _(f)+1]+i _(f)·ref₁[x+i _(i)+2]  (7)

where i_(t) is the integer part of the horizontal displacement of theprojection point relative to the location [x][y] and may calculated as afunction of the tangent of the angle φ of the vertical prediction mode906 as follows

i _(i)=└(y+1)·tan φ┘,  (8)

and i_(f) is the fractional part of the horizontal displacement of theprojection point relative to the location [x][y] and may be calculatedas

i _(f)=((y+1)·tan φ)−└y+1)·tan φ┘.  (9)

where └·┘ is the integer floor.

For horizontal prediction modes, the position [x][y] of a sample incurrent block 904 may be projected onto the vertical line of referencesamples ref₂[y]. Sample prediction for horizontal prediction modes isgiven by:

p[x][y]=(1−i _(f))·ref₂[y+i _(i)+1]+i _(f)·ref₂[y+i _(i)+2]  (10)

where i_(i) is the integer part of the vertical displacement of theprojection point relative to the location [x][y] and may be calculatedas a function of the tangent of the angle φ of the horizontal predictionmode as follows

i _(i) =└x+1)·tan φ┘,  (11)

and i_(f) is the fractional part of the vertical displacement of theprojection point relative to the location [x][y] and may be calculatedas

i _(f)=((x+1)·tan φ)−└(x+1)·tan φ┘.  (12)

where └·┘ is the integer floor.

The interpolation functions of (7) and (10) may be implemented by anencoder or decoder, such as encoder 200 in FIG. 2 or decoder 300 in FIG.3 , as a set of two-tap finite impulse response (FIR) filters. Thecoefficients of the two-tap FIR filters may be respectively given by(1−i_(f)) and i_(f). In the above angular intra prediction examples, thepredicted sample p [x][y] may be calculated with some predefined levelof sample accuracy, such as 1/32 sample accuracy. For 1/32 sampleaccuracy, the set of two-tap FIR interpolation filters may comprise upto 32 different two-tap FIR interpolation filters—one for each of the 32possible values of the fractional part of the projected displacementi_(f). In other examples, different levels of sample accuracy may beused.

In an embodiment, the two-tap interpolation FIR filter may be used forpredicting chroma samples. For luma samples, a different interpolationtechnique may be used. For example, for luma samples a four-tap FIRfilter may be used to determine a predicted value of a luma sample. Forexample, the four tap FIR filter may have coefficients determined basedon i_(f), similar to the two-tap FIR filter. For 1/32 sample accuracy, aset of 32 different four-tap FIR filters may comprise up to 32 differentfour-tap FIR filters—one for each of the 32 possible values of thefractional part of the projected displacement i_(f). In other examples,different levels of sample accuracy may be used. The set of four-tap FIRfilters may be stored in a look-up table (LUT) and referenced based oni_(f). The value of the predicted sample p[x][y], for verticalprediction modes, may be determined based on the four-tap FIR filter asfollows:

p[x][y]=Σ_(i=0) ³ fT[i]*ref[x+ildx+i]  (13)

where ft[i], i=0 . . . 0.3, are the filter coefficients. The value ofthe predicted sample p[x][y], for horizontal prediction modes, may bedetermined based on the four-tap FIR filter as follows:

p[x][y]=Σ_(i=0) ³ fT[i]*ref[y+ildx+i].  (14)

It should be noted that supplementary reference samples may beconstructed for the case where the position [x][y] of a sample incurrent block 904 to be predicted is projected to a negative xcoordinate, which happens with negative vertical prediction angles φ.The supplementary reference samples may be constructed by projecting thereference samples in ref₂ [y] in the vertical line of reference samples902 to the horizontal line of reference samples 902 using the negativevertical prediction angle φ. Supplemental reference samples may besimilarly for the case where the position [x][y] of a sample in currentblock 904 to be predicted is projected to a negative y coordinate, whichhappens with negative horizontal prediction angles φ. The supplementaryreference samples may be constructed by projecting the reference samplesin ref₁ [x] on the horizontal line of reference samples 902 to thevertical line of reference samples 902 using the negative horizontalprediction angle φ.

An encoder may predict the samples of a current block being encoded,such as current block 904, for a plurality of intra prediction modes asexplained above. For example, the encoder may predict the samples of thecurrent block for each of the 35 intra prediction modes in HEVC or 67intra prediction modes in VVC. For each intra prediction mode applied,the encoder may determine a prediction error for the current block basedon a difference (e.g., sum of squared differences (SSD), sum of absolutedifferences (SAD), or sum of absolute transformed differences (SATD))between the prediction samples determined for the intra prediction modeand the original samples of the current block. The encoder may selectone of the intra prediction modes to encode the current block based onthe determined prediction errors. For example, the encoder may select anintra prediction mode that results in the smallest prediction error forthe current block. In another example, the encoder may select the intraprediction mode to encode the current block based on a rate-distortionmeasure (e.g., Lagrangian rate-distortion cost) determined using theprediction errors. The encoder may send an indication of the selectedintra prediction mode and its corresponding prediction error to adecoder for decoding of the current block.

Similar to an encoder, a decoder may predict the samples of a currentblock being decoded, such as current block 904, for an intra predictionmodes as explained above. For example, the decoder may receive anindication of an angular intra prediction mode from an encoder for ablock. The decoder may construct a set of reference samples and performintra prediction based on the angular intra prediction mode indicated bythe encoder for the block in a similar manner as discussed above for theencoder. The decoder would add the predicted values of the samples ofthe block to a residual of the block to reconstruct the block. Inanother embodiment, the decoder may not receive an indication of anangular intra prediction mode from an encoder for a block. Instead, thedecoder may determine an intra prediction mode through other,decoder-side means.

Although the description above was primarily made with respect to intraprediction modes in HEVC and VVC, it will be understood that thetechniques of the present disclosure described above and further belowmay be applied to other intra prediction modes, including those of othervideo coding standards like VP8, VP9, AV1, and the like.

As explained above, intra prediction may exploit correlations betweenspatially neighboring samples in the same picture of a video sequence toperform video compression. Inter prediction is another coding tool thatmay be used to exploit correlations in the time domain between blocks ofsamples in different pictures of the video sequence to perform videocompression. In general, an object may be seen across multiple picturesof a video sequence. The object may move (e.g., by some translationand/or affine motion) or remain stationary across the multiple pictures.A current block of samples in a current picture being encoded maytherefore have a corresponding block of samples in a previously decodedpicture that accurately predicts the current block of samples. Thecorresponding block of samples may be displaced from the current blockof samples due to movement of an object, represented in both blocks,across the respective pictures of the blocks. The previously decodedpicture may be referred to as a reference picture and the correspondingblock of samples in the reference picture may be referred to as areference block or motion compensated prediction. An encoder may use ablock matching technique to estimate the displacement (or motion) anddetermine the reference block in the reference picture.

Similar to intra prediction, once a prediction for a current block isdetermined and/or generated using inter prediction, an encoder maydetermine a difference between the current block and the prediction. Thedifference may be referred to as a prediction error or residual. Theencoder may then store and/or signal in a bitstream the prediction errorand other related prediction information for decoding or other forms ofconsumption. A decoder may decode the current block by predicting thesamples of the current block using the prediction information andcombining the predicted samples with the prediction error.

FIG. 13A illustrates an example of inter prediction performed for acurrent block 1300 in a current picture 1302 being encoded. An encoder,such as encoder 200 in FIG. 2 , may perform inter prediction todetermine and/or generate a reference block 1304 in a reference picture1306 to predict current block 1300. Reference pictures, like referencepicture 1306, are prior decoded pictures available at the encoder anddecoder. Availability of a prior decoded picture may depend on whetherthe prior decoded picture is available in a decoded picture buffer atthe time current block 1300 is being encoded or decoded. The encodermay, for example, search one or more reference pictures for a referenceblock that is similar to current block 1300. The encoder may determine a“best matching” reference block from the blocks tested during thesearching process as reference block 1304. The encoder may determinethat reference block 1304 is the best matching reference block based onone or more cost criterion, such as a rate-distortion criterion (e.g.,Lagrangian rate-distortion cost). The one or more cost criterion may bebased on, for example, a difference (e.g., sum of squared differences(SSD), sum of absolute differences (SAD), or sum of absolute transformeddifferences (SATD)) between the prediction samples of reference block1304 and the original samples of current block 1300.

The encoder may search for reference block 1304 within a referenceregion 1308. Reference region 1308 may be positioned around thecollocated position (or block) 1310 of current block 1300 in referencepicture 1306. In some instances, reference region 1308 may at leastpartially extend outside of reference picture 1306. When extendingoutside of reference picture 1306, constant boundary extension may beused such that the values of the samples in the row or column ofreference picture 1306, immediately adjacent to the portion of referenceregion 1308 extending outside of reference picture 1306, are used forthe “sample” locations outside of reference picture 1306. All or asubset of potential positions within reference region 1308 may besearched for reference block 1304. The encoder may utilize any one of anumber of different search implementations to determine and/or generatereference block 1304. For example, the encoder may determine a set of acandidate search positions based on motion information of neighboringblocks to current block 1300.

One or more reference pictures may be searched by the encoder duringinter prediction to determine and/or generate the best matchingreference block. The reference pictures searched by the encoder may beincluded in one or more reference picture lists. For example, in HEVCand VVC, two reference picture lists may be used, a reference picturelist 0 and a reference picture list 1. A reference picture list mayinclude one or more pictures. Reference picture 1306 of reference block1304 may be indicated by a reference index pointing into a referencepicture list comprising reference picture 1306.

The displacement between reference block 1304 and current block 1300 maybe interpreted as an estimate of the motion between reference block 1304and current block 1300 across their respective pictures. Thedisplacement may be represented by a motion vector 1312. For example,motion vector 1312 may be indicated by a horizontal component (MV_(x))and a vertical component (MV_(y)) relative to the position of currentblock 1300. FIG. 13B illustrates the horizontal component and verticalcomponent of motion vector 1312. A motion vector, such as motion vector1312, may have fractional or integer resolution. A motion vector withfractional resolution may point between two samples in a referencepicture to provide a better estimation of the motion of current block1300. For example, a motion vector may have ½, ¼, ⅛, 1/16, or 1/32fractional sample resolution. When a motion vector points to anon-integer sample value in the reference picture, interpolation betweensamples at integer positions may be used to generate the reference blockand its corresponding samples at fractional positions. The interpolationmay be performed by a filter with two or more taps.

Once reference block 1304 is determined and/or generated for currentblock 1300 using inter prediction, the encoder may determine adifference (e.g., a corresponding sample-by-sample difference) betweenreference block 1304 and current block 1300. The difference may bereferred to as a prediction error or residual. The encoder may thenstore and/or signal in a bitstream the prediction error and the relatedmotion information for decoding or other forms of consumption. Themotion information may include motion vector 1312 and a reference indexpointing into a reference picture list comprising reference picture1306. In other instances, the motion information may include anindication of motion vector 1312 and an indication of the referenceindex pointing into the reference picture list comprising referencepicture 1306. A decoder may decode current block 1300 by determiningand/or generating reference block 1304, which forms the prediction ofcurrent block 1300, using the motion information and combining theprediction with the prediction error.

In FIG. 13A, inter prediction is performed using one reference picture1306 as the source of the prediction for current block 1300. Because theprediction for current block 1300 comes from a single picture, this typeof inter prediction is referred to as uni-prediction. FIG. 14illustrates another type of inter prediction, referred to asbi-prediction, performed for a current block 1400. In bi-prediction, thesource of the prediction for a current block 1400 comes from twopictures. Bi-prediction may be useful, for example, where the videosequence comprises fast motion, camera panning or zooming, or scenechanges. Bi-prediction may also be useful to capture fade outs of onescene or fade outs from one scene to another, where two pictures areeffectively displayed simultaneously with different levels of intensity.

Whether uni-prediction or both uni-prediction and bi-prediction areavailable for performing inter prediction may depend on a slice type ofcurrent block 1400. For P slices, only uni-prediction may be availablefor performing inter prediction. For B slices, either uni-prediction orbi-prediction may be used. When uni-prediction is performed, an encodermay determine and/or generate a reference block for predicting currentblock 1400 from reference picture list 0. When bi-prediction isperformed, an encoder may determine and/or generate a first referenceblock for predicting current block 1400 from reference picture list 0and determine and/or generate a second reference block for predictingcurrent block 1400 from reference picture list 1.

In FIG. 14 , inter-prediction is performed using bi-prediction, wheretwo reference blocks 1402 and 1404 are used to predict current block1400. Reference block 1402 may be in a reference picture of one ofreference picture list 0 or 1, and reference block 1404 may be in areference picture of the other one of reference picture list 0 or 1. Asshown in FIG. 14 , reference block 1402 is in a picture that precedesthe current picture of current block 1400 in terms of picture ordercount (POC), and reference block 1402 is in a picture that proceeds thecurrent picture of current block 1400 in terms of POC. In otherexamples, the reference pictures may both precede or proceed the currentpicture in terms of POC. POC is the order in which pictures are outputfrom, for example, a decoded picture buffer and is the order in whichpictures are generally intended to be displayed. However, it should benoted that pictures that are output are not necessarily displayed butmay undergo different processing or consumption, such as transcoding. Inother examples, the two reference blocks determined and/or generatedusing bi-prediction may come from the same reference picture. In such aninstance, the reference picture may be included in both referencepicture list 0 and reference picture list 1.

A configurable weight and offset value may be applied to the one or moreinter prediction reference blocks. An encoder may enable the use ofweighted prediction using a flag in a picture parameter set (PPS) andsignal the weighting and offset parameters in the slice segment headerfor the current block. Different weight and offset parameters may besignaled for luma and chroma components.

Once reference blocks 1402 and 1404 are determined and/or generated forcurrent block 1400 using inter prediction, the encoder may determine adifference between current block 1400 and each of reference blocks 1402and 1404. The differences may be referred to as prediction errors orresiduals. The encoder may then store and/or signal in a bitstream theprediction errors and their respective related motion information fordecoding or other forms of consumption. The motion information forreference block 1402 may include motion vector 1406 and the referenceindex pointing into the reference picture list comprising the referencepicture of reference block 1402. In other instances, the motioninformation for reference block 1402 may include an indication of motionvector 1406 and an indication of the reference index pointing into thereference picture list comprising reference picture 1402. The motioninformation for reference block 1404 may include motion vector 1408 andthe reference index pointing into the reference picture list comprisingthe reference picture of reference block 1404. In other instances, themotion information for reference block 1404 may include an indication ofmotion vector 1408 and an indication of the reference index pointinginto the reference picture list comprising reference picture 1404. Adecoder may decode current block 1400 by determining and/or generatingreference blocks 1402 and 1404, which together form the prediction ofcurrent block 1400, using their respective motion information andcombining the predictions with the prediction errors.

In HEVC, VVC, and other video compression schemes, motion informationmay be predictively coded before being stored or signaled in a bitstream. The motion information for a current block may be predictivelycoded based on the motion information of neighboring blocks of thecurrent block. In general, the motion information of the neighboringblocks is often correlated with the motion information of the currentblock because the motion of an object represented in the current blockis often the same or similar to the motion of objects in the neighboringblocks. Two of the motion information prediction techniques in HEVC andVVC include advanced motion vector prediction (AMVP) and interprediction block merging.

An encoder, such as encoder 200 in FIG. 2 , may code a motion vectorusing the AMVP tool as a difference between the motion vector of acurrent block being coded and a motion vector predictor (MVP). Anencoder may select the MVP from a list of candidate MVPs. The candidateMVPs may come from previously decoded motion vectors of neighboringblocks in the current picture of the current block or blocks at or nearthe collocated position of the current block in other referencepictures. Both the encoder and decoder may generate or determine thelist of candidate MVPs.

After the encoder selects an MVP from the list of candidate MVPs, theencoder may signal, in a bitstream, an indication of the selected MVPand a motion vector difference (MVD). The encoder may indicate theselected MVP in the bitstream by an index pointing into the list ofcandidate MVPs. The MVD may be calculated based on the differencebetween the motion vector of the current block and the selected MVP. Forexample, for a motion vector represented by a horizontal component(MV_(x)) and a vertical displacement (MV_(y)) relative to the positionof the current block being coded, the MVD may be represented by twocomponents calculated as follows:

MVD_(x)=MV_(x)−MVP_(x)  (15)

MVD_(y)=MV_(y)−MVP_(y)  (16)

where MVD_(x) and MVD_(y) respectively represent the horizontal andvertical components of the MVD, and MVP_(x) and MVP_(y) respectivelyrepresent the horizontal and vertical components of the MVP. A decoder,such as decoder 300 in FIG. 3 , may decode the motion vector by addingthe MVD to the MVP indicated in the bitstream. The decoder may thendecode the current block by determining and/or generating the referenceblock, which forms the prediction of the current block, using thedecoded motion vector and combining the prediction with the predictionerror.

In HEVC and VVC, the list of candidate MVPs for AMVP may comprise twocandidates referred to as candidates A and B. Candidates A and B mayinclude up to two spatial candidate MVPs derived from five spatialneighboring blocks of the current block being coded, one temporalcandidate MVP derived from two temporal, co-located blocks when bothspatial candidate MVPs are not available or are identical, or zeromotion vectors when the spatial, temporal, or both candidates are notavailable. FIG. 15A illustrates the location of the five spatialcandidate neighboring blocks relative to a current block 1500 beingencoded. The five spatial candidate neighboring blocks are respectivelydenoted A₀, A₁, B₀, B₁, and B₂. FIG. 15B illustrates the location of thetwo temporal, co-located blocks relative to current block 1500 beingcoded. The two temporal, co-located blocks are denoted C₀ and C₁ and areincluded in a reference picture that is different from the currentpicture of current block 1500.

An encoder, such as encoder 200 in FIG. 2 , may code a motion vectorusing the inter prediction block merging tool also referred to as mergemode. Using merge mode, the encoder may reuse the same motioninformation of a neighboring block for inter prediction of a currentblock. Because the same motion information of a neighboring block isused, no MVD needs to be signaled and the signaling overhead forsignaling the motion information of the current block may be small insize. Similar to AMVP, both the encoder and decoder may generate acandidate list of motion information from neighboring blocks of thecurrent block. The encoder may then determine to use (or inherit) themotion information of one neighboring block's motion information in thecandidate list for predicting the motion information of the currentblock being coded. The encoder may signal, in the bit stream, anindication of the determined motion information from the candidate list.For example, the encoder may signal an index pointing into the list ofcandidate motion information to indicate the determined motioninformation.

In HEVC and VVC, the list of candidate motion information for merge modemay comprise up to four spatial merge candidates that are derived fromthe five spatial neighboring blocks used in AMVP as shown in FIG. 15A,one temporal merge candidate derived from two temporal, co-locatedblocks used in AMVP as shown in FIG. 15B, and additional mergecandidates including bi-predictive candidates and zero motion vectorcandidates.

It should be noted that inter prediction may be performed in other waysand variants than those described above. For example, motion informationprediction techniques other than AMVP and merge mode are possible. Inaddition, although the description above was primarily made with respectto inter prediction modes in HEVC and VVC, it will be understood thatthe techniques of the present disclosure described above and furtherbelow may be applied to other inter prediction modes, including those ofother video coding standards like VP8, VP9, AV1, and the like. Inaddition, history based motion vector prediction (HMVP), combinedintra/inter prediction mode (CIIP), and merge mode with motion vectordifference (MMVD) as described in VVC may also be performed and arewithin the scope of the present disclosure.

In inter prediction, a block matching technique may be applied todetermine a reference block in a different picture than the currentblock being encoded. Block matching techniques have also been applied todetermine a reference block in the same picture as a current block beingencoded. However, it has been determined that for camera-capturedvideos, a reference block in the same picture as the current blockdetermined using block matching may often not accurately predict thecurrent block. For screen content video this is generally not the case.Screen content video may include, for example, computer generated text,graphics, and animation. Within screen content, there is often repeatedpatterns (e.g., repeated patterns of text and graphics) within the samepicture. Therefore, a block matching technique applied to determine areference block in the same picture as a current block being encoded mayprovide efficient compression for screen content video.

HEVC and VVC both include a prediction technique to exploit thecorrelation between blocks of samples within the same picture of screencontent video. This technique is referred to as intra block (IBC) orcurrent picture referencing (CPR). Similar to inter prediction, anencoder may apply a block matching technique to determine a displacementvector (referred to as a block vector (BV)) that indicates the relativedisplacement from the current block to a reference block (or intra blockcompensated prediction) that “best matches” the current block. Theencoder may determine the best matching reference block from blockstested during a searching process similar to inter prediction. Theencoder may determine that a reference block is the best matchingreference block based on one or more cost criterion, such as arate-distortion criterion (e.g., Lagrangian rate-distortion cost). Theone or more cost criterion may be based on, for example, a difference(e.g., sum of squared differences (SSD), sum of absolute differences(SAD), sum of absolute transformed differences (SATD), or differencedetermined based on a hash function) between the prediction samples ofthe reference block and the original samples of the current block. Areference block may correspond to prior decoded blocks of samples of thecurrent picture. The reference block may comprise decoded blocks ofsamples of the current picture prior to being processed by in-loopfiltering operations, like deblocking or SAO filtering. FIG. 16illustrates an example of IBC applied for screen content. Therectangular portions with arrows beginning at their boundaries arecurrent blocks being encoded and the rectangular portions that thearrows point to are the reference blocks for predicting the currentblocks.

Once a reference block is determined and/or generated for a currentblock using IBC, the encoder may determine a difference (e.g., acorresponding sample-by-sample difference) between the reference blockand the current block. The difference may be referred to as a predictionerror or residual. The encoder may then store and/or signal in abitstream the prediction error and the related prediction informationfor decoding or other forms of consumption. The prediction informationmay include a BV. In other instances, the prediction information mayinclude an indication of the BV. A decoder, such as decoder 300 in FIG.3 , may decode the current block by determining and/or generating thereference block, which forms the prediction of the current block, usingthe prediction information and combining the prediction with theprediction error.

In HEVC, VVC, and other video compression schemes, a BV may bepredictively coded before being stored or signaled in a bit stream. TheBV for a current block may be predictively coded based on the BV ofneighboring blocks of the current block. For example, an encoder maypredictively code a BV using the merge mode as explained above for interprediction or a similar technique as AMVP also explained above for interprediction. The technique similar to AMVP may be referred to as BVprediction and difference coding.

For BV prediction and difference coding, an encoder, such as encoder 200in FIG. 2 , may code a BV as a difference between the BV of a currentblock being coded and a BV predictor (BVP). An encoder may select theBVP from a list of candidate BVPs. The candidate BVPs may come frompreviously decoded BVs of neighboring blocks of the current block in thecurrent picture. Both the encoder and decoder may generate or determinethe list of candidate BVPs.

After the encoder selects a BVP from the list of candidate BVPs, theencoder may signal, in a bitstream, an indication of the selected BVPand a BV difference (BVD). The encoder may indicate the selected BVP inthe bitstream by an index pointing into the list of candidate BVPs. TheBVD may be calculated based on the difference between the BV of thecurrent block and the selected BVP. For example, for a BV represented bya horizontal component (BV_(x)) and a vertical component (BV_(y))relative to the position of the current block being coded, the BVD mayrepresented by two components calculated as follows:

BVD_(x)=BV_(x)−BVP_(x)  (17)

BVD_(y)=BV_(y)−BVP_(y)  (18)

where BVD_(x) and BVD_(y) respectively represent the horizontal andvertical components of the BVD, and BVP_(x) and BVP_(y) respectivelyrepresent the horizontal and vertical components of the BVP. A decoder,such as decoder 300 in FIG. 3 , may decode the BV by adding the BVD tothe BVP indicated in the bitstream. The decoder may then decode thecurrent block by determining and/or generating the reference block,which forms the prediction of the current block, using the decoded BVand combining the prediction with the prediction error.

In HEVC and VVC, the list of candidate BVPs may comprise two candidatesreferred to as candidates A and B. Candidates A and B may include up totwo spatial candidate BVPs derived from five spatial neighboring blocksof the current block being encoded, or one or more of the last two codedBVs when spatial neighboring candidates are not available (e.g., becausethey are coded in intra or inter mode). The location of the five spatialcandidate neighboring blocks relative to a current block being encodedusing IBC are the same as those shown in FIG. 15A for inter prediction.The five spatial candidate neighboring blocks are respectively denotedA₀, A₁, B₀, B₁, and B₂.

In existing technologies, a BV for a current block coded using IBC maybe constrained to indicate a relative displacement from the currentblock to a reference block within an IBC reference region. However, aBVP used to predicatively code a BV may not be similarly constrained.This is because a BVP may be derived from a BV of a spatiallyneighboring block of the current block or a prior coded BV as explainedabove. Because the BVP used to predicatively code a BV may not beconstrained to indicate a relative displacement from a current block toa reference block within an IBC reference region like the BV, the BVPmay not accurately predict the BV. This may potentially increase thenumber of bits needed to transmit a BVD between the BV and BVP.

Embodiments of the present disclosure are directed to apparatuses andmethods for adjusting a BVP to provide a more accurate prediction of aBV determined using an IBC mode. Embodiments of the present disclosuremay determine whether a coordinate (e.g., a horizontal or verticalcoordinate) of a sample, displaced relative to a current block by anamount indicated by the BVP, is outside a range of values of thecoordinate for samples in a reference region for the current block.Based on this determination, embodiments may adjust a component,corresponding to the coordinate, of the BVP to have an adjusted valuecloser to the range of values of the coordinate for the samples in thereference region. Embodiments may then use the adjusted BVP to determineor predict the BV. These and other features of the present disclosureare described further below.

FIG. 17 illustrates an example IBC coding in accordance with embodimentsof the present disclosure. In FIG. 17 , an encoder, such as encoder 200in FIG. 2 , uses an IBC mode to code a current block 1700 in a currentpicture (or portion of a current picture) 1702. Current block 1700 maybe a prediction block (PB) or coding block (CB) within a coding treeunit (CTU) 1704. Unlike inter prediction that searches for a referenceblock in a prior decoded picture that is different than the picture ofthe current block being encoded, IBC searches for a reference block inthe same, current picture as the current block. As a result, only partof the current picture may be available for searching for a referenceblock in IBC. For example, only the part of the current picture that hasbeen decoded prior to the encoding of the current block. This may ensurethe encoding and decoding systems can produce identical results but alsolimits the IBC reference region.

In HEVC, VVC, and other video compression standards, blocks may bescanned from left-to-right, top-to-bottom using a z-scan to form thesequence order for encoding/decoding. Based on the z-scan, CTUs(represented by the large, square tiles in FIG. 17 ) to the left and inthe row immediately above current CTU 1704 may be encoded/decoded priorto current CTU 1704 and current block 1700. Therefore, the samples ofthese CTUs (shown with hatching in FIG. 17 ) may form an exemplary IBCreference region 1706 for determining a reference block to predictcurrent block 1700. In other video encoders and decoders, a differentsequence order for encoding/decoding may be used, which may influenceIBC reference region 1706 accordingly.

In addition to the encoding/decoding sequence order, one or moreadditional reference region constraints may be placed on IBC referenceregion 1706. For example, IBC reference region 1706 may be constrainedbased on a limited memory for storing reference samples or to CTUs basedon a parallel processing approach, like tiles or wavefront parallelprocessing (WPP). Tiles may be used as part of a picture partitioningprocess for flexibly subdividing a picture into rectangular regions ofCTUs such that coding dependencies between CTUs of different tiles arenot allowed. WPP may be similarly used as part of a picture partitioningprocess for partitioning a picture into CTU rows such that dependenciesbetween CTUs of different partitions are not allowed. Each of thesetools may enable parallel processing of the picture partitions. The CTUsin the left column and top row shown in FIG. 17 may not be part of IBCreference region 1706 due to a limited memory for storing referencesamples and/or due to one of the parallel processing approaches.

The encoder may apply a block matching technique to determine a blockvector (BV) 1708 that indicates the relative displacement from currentblock 1700 to a reference block 1710 (or intra block compensatedprediction) within IBC reference region 1706 that “best matches” currentblock 1700. IBC reference region 1706 is a constraint placed on BV 1708.BV 1708 is constrained by IBC reference region 1706 to indicate adisplacement from current block 1700 to a reference block that is withinIBC reference region 1706. The encoder may determine the best matchingreference block from blocks tested, within IBC reference region 1706,during a searching process. The encoder may determine that a referenceblock is the best matching reference block based on one or more costcriterion, such as a rate-distortion criterion (e.g., Lagrangianrate-distortion cost). The one or more cost criterion may be based on,for example, a difference (e.g., sum of squared differences (SSD), sumof absolute differences (SAD), sum of absolute transformed differences(SATD), or difference determined based on a hash function) between theprediction samples of the reference block and the original samples ofthe current block. Reference block 1710 may comprise decoded (orreconstructed) samples of current picture 1702 prior to being processedby in-loop filtering operations, like deblocking or SAO filtering.

Once reference block 1710 is determined and/or generated for currentblock 1700 using IBC, the encoder may determine or use a difference(e.g., a corresponding sample-by-sample difference) between currentblock 1700 and reference block 1710. The difference may be referred toas a prediction error or residual. The encoder may then store and/orsignal in a bitstream the prediction error and the related predictioninformation for decoding.

The prediction information may include BV 1708. In other instances, theprediction information may include an indication of BV 1708. Forexample, in HEVC, VVC, and other video compression schemes, BV 1708 maybe predictively coded before being stored or signaled in a bit stream asexplained previously above. BV 1708 for current block 1700 may bepredictively coded using a similar technique as AMVP for interprediction. This technique may be referred to as BV prediction anddifference coding. For the BV prediction and difference codingtechnique, the encoder may code BV 1708 as a difference between BV 1708and a BV predictor (BVP) 1712. The encoder may select BVP 1712 from alist of candidate BVPs. The candidate BVPs may come from previouslydecoded BVs of neighboring blocks of current block 1700 or from othersources. Both the encoder and decoder may generate or determine the listof candidate BVPs.

After the encoder selects BVP 1712 from the list of candidate BVPs, theencoder may determine a BV difference (BVD) 1714. BVD 1714 may becalculated based on the difference between BV 1708 and BVP 1712. Forexample, BVD 1714 may be represented by two directional componentscalculated according to equations (17) and (18) above, which arereproduced below:

BVD_(x)=BV_(x)−BVP_(x)  (17)

BVD_(y)=BV_(y)−BVP_(y)  (18)

where BVD_(x) and BVD_(y) respectively represent the horizontal andvertical components of BVD 1714, BV_(x) and BV_(y) respectivelyrepresent the horizontal and vertical components of BV 1708, and BVP_(x)and BVP_(y) respectively represent the horizontal and verticalcomponents of BVP 1712. The horizontal x-axis and vertical y-axis areindicated in the lower right hand corner of current picture 1702 forreference purposes.

The encoder may signal, in a bit stream, the prediction error, anindication of the selected BVP 1712 (e.g., via an index pointing intothe list of candidate BVPs), and the separate components of BVD 1714given by equations (17) and (18). A decoder, such as decoder 300 in FIG.3 , may decode BV 1708 by adding corresponding components of BVD 1714 tocorresponding components of BVP 1712. The decoder may then decodecurrent block 1700 by determining and/or generating reference block1710, which forms the prediction of current block 1700, using thedecoded BV and combining the prediction with the prediction errorreceived in the bitstream.

As can be seen from FIG. 17 , BVP 1712 indicates a relative displacementfrom a position of current block 1700 to a sample position 1716. Theposition of current block 1700 may be determined by the position of thetop left sample of current block 1700. Sample position 1716 may be aninteger sample position or a fractional sample position between two,integer sample positions. Because BVP 1712 may be derived from spatiallyneighboring blocks of current block 1700 and/or prior coded BVs, sampleposition 1716 indicated by BVP 1712 may be outside IBC reference region1706, which is the case shown in FIG. 17 . BV 1708, on the other hand,may be constrained to indicate a relative displacement from currentblock 1700 to a position of a reference block within IBC referenceregion 1706. The position of the reference block may be determined bythe position of the top left sample of the reference block. Thus, BVP1712 may not accurately predict BV 1708 because BVP 1712 indicates arelative displacement from current block 1700 to sample position 1716that is outside IBC reference region 1706. Embodiments of the presentdisclosure may adjust BVPs, such as BVP 1716, to more accurately predicta BV.

In an embodiment, the encoder or decoder of FIG. 17 may determinewhether a coordinate (e.g., a horizontal or vertical coordinate) ofsample position 1716 is outside a range of values of the coordinate forsamples in IBC reference region 1706. For example, the encoder ordecoder may determine whether an x-coordinate of sample position 1716 isoutside the range of values x₀-x₁, which is the range of values of thex-coordinate for samples in IBC reference region 1706 as shown in FIG.17 . In an embodiment, the encoder or decoder may determine whether anx-coordinate of sample position 1716 is less than the lower bound x₀ ofthe range of values x₀-x₁, and/or whether an x-coordinate of sampleposition 1716 is greater than the upper bound x₁ of the range of valuesx₀-x₁. In another embodiment, the encoder or decoder may adjust theupper bound x₁ of the range of values x₀-x₁ based on a width of currentblock 1700 before making such a comparison. This adjustment may be madewhere BV 1708 is constrained to indicate a reference block entirelywithin the bounds of IBC reference region 1706. The new upper bound x′₁may be equal to x₁ less the width of current block 1700.

In another example, the encoder or decoder may determine whether ay-coordinate of sample position 1716 is outside the range of valuesy₀-y₁, which is the range of values of the y-coordinate for samples inIBC reference region 1706 as shown in FIG. 17 . In an embodiment, theencoder or decoder may determine whether a y-coordinate of sampleposition 1716 is less than the lower bound y₀ of the range of valuesy₀-y₁, and/or whether a y-coordinate of sample position 1716 is greaterthan the upper bound y₁ of the range of values y₀-y₁. In anotherembodiment, the encoder or decoder may adjust the upper bound y₁ of therange of values y₀-y₁ based on a height of current block 1700 beforemaking such a comparison. This adjustment may be made where BV 1708 isconstrained to indicate a reference block entirely within the bounds ofIBC reference region 1706. The new upper bound y′₁ may be equal to y₁less the height of current block 1700.

In an embodiment, based on determining a coordinate of sample position1716 is outside a range of values of the coordinate for samples in IBCreference region 1716, the encoder or decoder may adjust a component,corresponding to a direction of the coordinate, of BVP 1712. Forexample, the encoder or decoder may adjust the component to have anadjusted value closer to the range of values of the coordinate for thesamples in reference region 1716. In an embodiment, the encoder ordecoder may adjust the component to have a value equal to a maximum orminimum value of the range of values. In an embodiment, the encoder ordecoder may adjust the component to have a value equal to the maximumvalue of the range of values based on the coordinate of sample position1716 being greater than the upper bound of the range of values. In anembodiment, the encoder or decoder may adjust the component to have avalue equal to the minimum value of the range of values based on thecoordinate of sample position 1716 being less than the lower bound ofthe range of values. In an embodiment, the encoder or decoder may adjustthe component to have a value equal to a closer one of a maximum orminimum value of the range of values. In an embodiment, both thehorizontal and vertical component of BVP 1712 may be adjusted based onthe above.

In an embodiment, the encoder or decoder may use BVP 1712, with theadjusted component, to predict (in the case of encoder) or determine (inthe case of decoder) BV 1708 in the same manner as explained above withrespect to BVP 1712 without the adjusted component. In an embodiment,the encoder may perform the method discussed above for each BVPcandidate in a list of BVP candidates. After adjusting one or more ofthe BVP candidates in the list of BVP candidates, the encoder may thenselect one of the BVP candidates to predict the BV. In an embodiment,the decoder may perform the method discussed above for the selected BVPindicated by the encoder in a bitstream to predict the BV. Afteradjusting the selected BVP, the decoder may the determine the BV byadding the BVP to the BVD, which may have been further indicated by theencoder in the bitstream.

Continuing with the example of FIG. 17 , FIG. 18 illustrates anadjustment to BVP 1712 that was made in the manner discussed above withrespect to FIG. 17 . More specifically, based on determining thex-coordinate of sample position 1716 is less than the lower bound of therange of values x₀-x₁ (or the range of values x₀-x′₁) of thex-coordinate for samples in IBC reference region 1706, the encoder ordecoder adjusts the x-component of BVP 1712 to have a value closer tothe minimum value x₀ of the range of values. In the case of FIG. 18 ,the encoder or decoder adjusts the x-component of BVP 1712 to have avalue equal to the minimum value x₀ of the range of values. The resultof this adjustment to BVP 1712 is adjusted BVP 1812. As can be seen fromFIG. 18 , adjusted BVP 1812 provides a better prediction of BV 1708 byreducing the length of the horizontal component BVD_(x) of BVD 1814compared to the horizontal component of BVD_(x) of BVD 1714 in FIG. 17 .

Continuing with the example of FIG. 17 , FIG. 19 illustrates anotheradjustment to BVP 1712 that was made in the manner discussed above withrespect to FIG. 17 . More specifically, based on determining they-coordinate of sample position 1716 is less than the lower bound of therange of values y₀-y₁ (or the range of values y₀-y′₁) of they-coordinate for samples in IBC reference region 1706, the encoder ordecoder adjusts the y-component of BVP 1712 to have a value closer tothe minimum value y₀ of the range of values. In the case of FIG. 19 ,the encoder or decoder adjusts the y-component of BVP 1712 to have avalue equal to the minimum value y₀ of the range of values. The resultof this adjustment to BVP 1712 is adjusted BVP 1912. As can be seen fromFIG. 19 , adjusted BVP 1912 provides a better prediction of BV 1708 byreducing the length of the vertical component BVD_(y) of BVD 1914compared to the vertical component BVD_(y) of BVD 1714 in FIG. 17 .

Continuing with the example of FIG. 17 , FIG. 20 illustrates anotheradjustment to BVP 1712 that was made in the manner discussed above withrespect to FIG. 17 . More specifically, based on determining thex-coordinate of sample position 1716 is less than the lower bound of therange of values x₀-x₁ (or the range of values x₀-x′₁) of thex-coordinate for samples in IBC reference region 1706, the encoder ordecoder adjusts the x-component of BVP 1712 to have a value equal to theminimum value x₀ of the range of values. In addition, based ondetermining the y-coordinate of sample position 1716 is less than thelower bound of the range of values y₀-y₁ (or the range of values y₀-y′₁)of the y-coordinate for samples in IBC reference region 1706, theencoder or decoder adjusts the y-component of BVP 1712 to have a valueequal to the minimum value y₀ of the range of values. The result ofthese adjustments to BVP 1712 is adjusted BVP 2012. As can be seen fromFIG. 20 , adjusted BVP 2012 provides a better prediction of BV 1708 byreducing the length of both the horizontal and vertical components ofBVD 2014 compared to the horizontal and vertical components of BVD 1714in FIG. 17 .

In the examples of FIGS. 17-20 , IBC reference region 1706 was providedby way of example and not limitation. In other embodiments, the methodsdiscussed above with respect to FIGS. 17-20 may be applied based on IBCreference regions different than IBC reference region 1706 as would beappreciated by persons of ordinary skill in the art based on theteachings herein. For example, IBC reference region 1706 in the examplesof FIGS. 17-20 may be replaced by an IBC reference region determinedbased on a different set of IBC reference region constraints. Forexample, in addition to being constrained to a reconstructed part ofcurrent picture 1702 and potentially to a particular wavefront parallelprocessing (WPP) partition or tile partition as mentioned above withrespect to FIG. 17 , IBC reference region 1706 may be furtherconstrained to include a number of decoded or reconstructed samples thatmay be stored in a limited size IBC reference sample memory. The size ofthe IBC reference sample memory may be limited based on beingimplemented on-chip with the encoder or decoder. The IBC referenceregion may be increased in size by using a larger size IBC referencesample memory off-chip from the encoder or decoder; however, such anapproach may have its own drawbacks, such as increased off-chip memorybandwidth requirements and increased delay in writing and readingsamples in the IBC reference region to and from the IBC reference samplememory.

In an embodiment, with a limited size IBC reference sample memory, theIBC reference region may be constrained to: a reconstructed part of thecurrent CTU; and one or more reconstructed CTUs to the left of thecurrent CTU not including a portion, of a left most one of the one ormore reconstructed CTUs, collocated with either the reconstructed partof the current CTU or a virtual pipeline data unit (VPDU) in which thecurrent block being coded is located. Blocks of samples in differentCTUs may be collocated based on having a same size and CTU offset. A CTUoffset of a block may be the offset of the block's top-left cornerrelative to the top-left corner of the CTU in which the block islocated.

The IBC reference region may not include the portion, of the left mostone of the more reconstructed CTUs, that is collocated with thereconstructed part of the current CTU because the IBC reference samplememory may be implemented similar to a circular buffer. For example, theIBC reference sample memory may store reconstructed reference samplescorresponding to one or more CTUs. Once the IBC reference sample memoryis filled, reconstructed reference samples of the current CTU mayreplace the reconstructed reference samples of a CTU stored in the IBCreference sample memory that are located, within a picture or frame,farthest to the left of the current CTU. The samples of the CTU storedin the IBC reference sample memory that are located, within a picture orframe, farthest to the left of the current CTU may correspond to theoldest data in the IBC reference sample memory. This update mechanismallows some of the reconstructed reference samples from the left mostCTU to remain stored in the IBC reference sample memory when processingthe current CTU. The remaining reference samples of the left most CTUstored in the IBC reference sample memory may then be used forpredicting the current block in the current CTU.

In addition, in typical hardware implementations of an encoder ordecoder, a CTU may not be processed all at once. Instead, the CTU may bedivided into VPDUs for processing by a pipeline stage. A VPDU maycomprise a 4×4 region of samples, a 16×16 region of samples, a 32×32region of samples, a 64×64 region of samples, a 128×128 region ofsamples, or some other sample region size. In an embodiment, a size of aVPDU may be determined based on a minimum of a maximum VPDU size (e.g.,a 64×64 region of samples) and a size (e.g., a width or height) of acurrent CTU. The portion, of the left most one of the one or morereconstructed CTUs, that is collocated with the VPDU in which the blockbeing coded is located may be further excluded from the IBC referenceregion as mentioned above. By excluding this region of the left most oneof the one or more reconstructed CTUs from the IBC reference region, thecorresponding portion of the IBC reference sample memory used to storereconstructed reference samples from this region may be used to storeonly samples within the region of the current CTU corresponding to theVPDU, which may avoid certain complexities in design.

The number of reconstructed CTUs to the left of the current CTU includedin the IBC reference region may be determined based on the number ofreconstructed reference samples the IBC reference sample memory maystore and the size of the CTUs in the current picture. For example, thenumber of reconstructed CTUs to the left of the current CTU included inthe IBC reference region may be determined based on the number ofreconstructed reference samples the IBC reference sample memory maystore divided by the size of a CTU in the current picture. Thus, for anIBC reference sample memory that may store 128×128 reconstructedreference samples for the IBC reference region and a CTU size of 128×128samples, the number of reconstructed CTUs to the left of the current CTUincluded in the IBC reference region may be equal to (128×128)/(128×128)or 1 CTU. In another example, for a memory that may store 128×128reconstructed reference samples for the IBC reference region and a CTUsize of 64×64 samples, the number of reconstructed CTUs to the left ofthe current CTU included in the IBC reference region may be equal to(128×128)/(64×64) or 4 CTUs.

FIG. 21A illustrates an example IBC reference region 2100 determinedbased on an IBC reference sample memory size of 128×128 samples and aCTU size of 128×128 samples in accordance with embodiments of thepresent disclosure. Based on the IBC reference sample memory size of128×128 samples and a CTU size of 128×128 samples, the number ofreconstructed CTUs to the left of the current CTU included in the IBCreference region may be equal to (128×128)/(128×128) or 1 CTU.

FIG. 21A illustrates a current block 2102 within a current CTU 2104.Current block 2102 is the first block coded in current CTU 2104 and iscoded using IBC mode. As described above with respect to FIG. 17 , ablock is coded using IBC mode by determining a “best matching” referenceblock within an IBC reference region. In FIG. 21A, IBC reference region2100 is be constrained to: a reconstructed part of current CTU 2104; andthe single, reconstructed CTU 2106 to the left of current CTU 2104 notincluding a portion, of reconstructed CTU 2106, collocated with eitherthe reconstructed part of current CTU 2104 or a virtual pipeline dataunit (VPDU) 2108 in which current block 2102 is located. In the exampleof FIG. 21A, CTUs are divided into 4 VPDUs of size 64×64 samples.Accordingly, IBC reference region 2100 for current block 2102 includesreconstructed region 2110 (shown with hatching) except the 64×64 regionof reconstructed CTU 2106 collocated with VPDU 2108. This collocatedregion is marked with an “X” in FIG. 21A. It should be noted that, fordifferent size CTUs, the IBC reference region in FIG. 21A may include adifferent number of CTUs to the left of current CTU 2102 than thesingle, reconstructed CTU 2106. For example, for CTU sizes of 64×64, theIBC reference region may include 4 CTUs to the left of current CTU 2102based on the number of reconstructed reference samples the IBC referencesample memory may store divided by the size of the CTUs in the currentpicture.

FIG. 21B continues with the example of FIG. 21A for a later coded blockin current CTU 2104 in accordance with embodiments of the presentdisclosure. The later coded block is labeled as current block 2112 inFIG. 21B and is coded using IBC mode, as described above with respect toFIG. 17 , by determining a “best matching” reference block within an IBCreference region. IBC reference region 2118 for current block 2112 maybe constrained to: a reconstructed part of current CTU 2104; and thereconstructed CTU 2106 not including a portion, of reconstructed CTU2106, collocated with either the reconstructed part of current CTU 2104or a virtual pipeline data unit (VPDU) 2114 in which current block 2112is located. As mentioned above with respect to FIG. 21A, current CTU2104 is divided into 4 VPDUs of size 64×64 samples. Accordingly, IBCreference region 2118 in FIG. 21B for current block 2112 includesreconstructed region 2116 (shown with hatching) except the part of CTU2106 collocated with either the reconstructed part of current CTU 2104or VPDU 2114. These collocated regions are each marked with an “X” inFIG. 21B.

When the CTU size is 128×128, the left boundary of the IBC referenceregion in the left CTU may be different for the top row of VPDUs versusthe bottom row of VPDUs as shown in FIGS. 22A and 22B. When a currentblock is in the top-left VPDU of the current CTU and the BVP points tothe top VPDU row in the left reconstructed CTU, the left edge of the IBCreference region is the left edge of the top right VDPU in thereconstructed CTU. Otherwise, the BVP points to the bottom VPDU row inthe left reconstructed CTU and the left boundary is the left edge of theleft reconstructed CTU. In the case that the BVP points into thetop-left VPDU of the left reconstructed CTU, an encoder or decoder mayadjust the horizontal and vertical components of the BVP based on aminimum distance from the BVP to the right and bottom edges of the VPDU.If the orthogonal distance between the BVP and bottom edge of theneighbor VPDU is less than the orthogonal distance between the BVP andthe right edge of the VPDU, an encoder or decoder may down-shift the BVPto point to the bottom edge of the VPDU. Otherwise, an encoder ordecoder may crop the horizontal BVP to the right VPDU edge. FIGS. 22Aand 22B show both examples where the BVP is down-shifted andhorizontally cropped, respectively. The down-shifted and horizontallycropped BVPs are denoted by BVP* in each of FIGS. 22A and 22B. In anembodiment, the encoder or decoder may use the down-shifted orhorizontally cropped BVP, to predict (in the case of encoder) ordetermine (in the case of decoder) a BV in the same manner as explainedabove with respect to BVP 1712 of FIG. 17 without the adjustedcomponent.

When the CTU size is 128×128, the left boundary of the IBC referenceregion in the left CTU may be further different for the top row of VPDUsversus the bottom row of VPDUs as shown in FIGS. 23A and 23B. When acurrent block is in the top-right VPDU of the current CTU and the BVPpoints to the top VPDU row in the left reconstructed CTU, the left edgeof the IBC reference region is the right edge of the reconstructed CTU.Otherwise, the BVP points to the bottom VPDU row in the leftreconstructed CTU and the left boundary is the left edge of the leftreconstructed CTU. In the case that the BVP points into the top row ofVPDUs of the left reconstructed CTU, an encoder or decoder may adjustthe horizontal and vertical components of the BVP based on a minimumdistance from the BVP to the right edge of the reconstructed CTU andbottom edges of the VPDUs in the top row of VPDUs. If the orthogonaldistance between the BVP and bottom edges of the VPDUs in the top row ofVPDUs is less than the orthogonal distance between the BVP and the rightedge of the reconstructed CTU, an encoder or decoder may down-shift theBVP to point to the bottom edges of the VPDUs in the top row of VPDUs.Otherwise, an encoder or decoder may crop the horizontal BVP to theright edge of the reconstructed CTU. FIGS. 23A and 23B show bothexamples where the BVP is down-shifted and horizontally cropped,respectively. The down-shifted and horizontally cropped BVPs are denotedby BVP* in each of FIGS. 23A and 23B. In an embodiment, the encoder ordecoder may use the down-shifted or horizontally cropped BVP, to predict(in the case of encoder) or determine (in the case of decoder) a BV inthe same manner as explained above with respect to BVP 1712 of FIG. 17 .

FIG. 24 illustrates a flowchart 2400 of a method for adjusting acomponent of a BVP in accordance with embodiments of the presentdisclosure. The method of flowchart 2400 may be implemented by anencoder or decoder, such as encoder 200 in FIG. 2 or decoder 300 in FIG.3 .

The method of flowchart 2400 begins at 2402. At 2402, a value of acoordinate for a sample is determined to be outside a range of values ofthe coordinate for samples in a reference region. The sample isdisplaced relative to a current block being encoded or decoded by anamount indicated by the BVP. In an embodiment, an upper bound of therange of values of the coordinate is adjusted based on a width or heightof the current block.

At 2404, a component, corresponding to a direction of the coordinate, ofthe BVP is adjusted to have an adjusted value closer to the range ofvalues of the coordinate for the sample in the reference region. In anembodiment, adjusting the component comprises adjusting the component tohave a value equal to a maximum or minimum value of the range of values.In an embodiment, adjusting the component comprises adjusting thecomponent to have a value equal to a closer one of a maximum or minimumvalue of the range of values. In an embodiment, adjusting the componentcomprises adjusting the component to have a value equal to a maximumvalue of the range of values based on the coordinate of the sampleposition being greater than an upper bound of the range of values. In anembodiment, adjusting the component comprises adjusting the component tohave a value equal to a minimum value of the range of values based onthe coordinate of the sample position being less than a lower bound ofthe range of values. In an embodiment, the direction of the coordinateis a horizontal direction. In an embodiment, the direction of thecoordinate is a vertical direction.

At 2406, the BVP, with the component adjusted to have the adjustedvalue, is used to determine (in case of the encoder) or predict (in caseof the decoder) a BV for the current block.

Embodiments of the present disclosure may be implemented in hardwareusing analog and/or digital circuits, in software, through the executionof instructions by one or more general purpose or special-purposeprocessors, or as a combination of hardware and software. Consequently,embodiments of the disclosure may be implemented in the environment of acomputer system or other processing system. An example of such acomputer system 2500 is shown in FIG. 25 . Blocks depicted in thefigures above, such as the blocks in FIGS. 1, 2, and 3 , may execute onone or more computer systems 2500. Furthermore, each of the steps of theflowcharts depicted in this disclosure may be implemented on one or morecomputer systems 2500.

Computer system 2500 includes one or more processors, such as processor2504. Processor 2504 may be, for example, a special purpose processor,general purpose processor, microprocessor, or digital signal processor.Processor 2504 may be connected to a communication infrastructure 902(for example, a bus or network). Computer system 2500 may also include amain memory 2506, such as random access memory (RAM), and may alsoinclude a secondary memory 2508.

Secondary memory 2508 may include, for example, a hard disk drive 2510and/or a removable storage drive 2512, representing a magnetic tapedrive, an optical disk drive, or the like. Removable storage drive 2512may read from and/or write to a removable storage unit 2516 in awell-known manner. Removable storage unit 2516 represents a magnetictape, optical disk, or the like, which is read by and written to byremovable storage drive 2512. As will be appreciated by persons skilledin the relevant art(s), removable storage unit 2516 includes a computerusable storage medium having stored therein computer software and/ordata.

In alternative implementations, secondary memory 2508 may include othersimilar means for allowing computer programs or other instructions to beloaded into computer system 2500. Such means may include, for example, aremovable storage unit 2518 and an interface 2514. Examples of suchmeans may include a program cartridge and cartridge interface (such asthat found in video game devices), a removable memory chip (such as anEPROM or PROM) and associated socket, a thumb drive and USB port, andother removable storage units 2518 and interfaces 2514 which allowsoftware and data to be transferred from removable storage unit 2518 tocomputer system 2500.

Computer system 2500 may also include a communications interface 2520.Communications interface 2520 allows software and data to be transferredbetween computer system 2500 and external devices. Examples ofcommunications interface 2520 may include a modem, a network interface(such as an Ethernet card), a communications port, etc. Software anddata transferred via communications interface 2520 are in the form ofsignals which may be electronic, electromagnetic, optical, or othersignals capable of being received by communications interface 2520.These signals are provided to communications interface 2520 via acommunications path 2522. Communications path 2522 carries signals andmay be implemented using wire or cable, fiber optics, a phone line, acellular phone link, an RF link, and other communications channels.

As used herein, the terms “computer program medium” and “computerreadable medium” are used to refer to tangible storage media, such asremovable storage units 2516 and 2518 or a hard disk installed in harddisk drive 2510. These computer program products are means for providingsoftware to computer system 2500. Computer programs (also calledcomputer control logic) may be stored in main memory 2506 and/orsecondary memory 2508. Computer programs may also be received viacommunications interface 2520. Such computer programs, when executed,enable the computer system 2500 to implement the present disclosure asdiscussed herein. In particular, the computer programs, when executed,enable processor 2504 to implement the processes of the presentdisclosure, such as any of the methods described herein. Accordingly,such computer programs represent controllers of the computer system2500.

In another embodiment, features of the disclosure may be implemented inhardware using, for example, hardware components such as application-specific integrated circuits (ASICs) and gate arrays.Implementation of a hardware state machine to perform the functionsdescribed herein will also be apparent to persons skilled in the art.

What is claimed is:
 1. A method comprising: determining a value of acoordinate for a sample is outside a range of values of the coordinatefor samples in a reference region, wherein the sample is displacedrelative to a current block by an amount indicated by a block vectorpredictor (BVP); adjusting a component, corresponding to a direction ofthe coordinate, of the BVP to have an adjusted value closer to the rangeof values of the coordinate for the samples in the reference regionbased on the determining; and using the BVP, with the component adjustedto have the adjusted value, to determine or predict a block vector (BV)for the current block.
 2. The method of claim 1, wherein an upper boundof the range of values of the coordinate is adjusted based on a width orheight of the current block.
 3. The method of claim 1, wherein theadjusting the component comprises adjusting the component to have avalue equal to a maximum or minimum value of the range of values.
 4. Themethod of claim 1, wherein the adjusting the component comprisesadjusting the component to have a value equal to a closer one of amaximum or minimum value of the range of values.
 5. The method of claim1, wherein the adjusting the component comprises adjusting the componentto have a value equal to a maximum value of the range of values based onthe coordinate of the sample position being greater than an upper boundof the range of values.
 6. The method of claim 1, wherein the adjustingthe component comprises adjusting the component to have a value equal toa minimum value of the range of values based on the coordinate of thesample position being less than a lower bound of the range of values. 7.The method of claim 1, wherein the direction of the coordinate is ahorizontal direction.
 8. The method of claim 1, wherein the direction ofthe coordinate is a vertical direction.
 9. An apparatus comprising: oneor more processors; and memory storing instructions that, when executedby the one or more processors, cause the apparatus to: determine a valueof a coordinate for a sample is outside a range of values of thecoordinate for samples in a reference region, wherein the sample isdisplaced relative to a current block by an amount indicated by a blockvector predictor (BVP); adjust a component, corresponding to a directionof the coordinate, of the BVP to have an adjusted value closer to therange of values of the coordinate for the samples in the referenceregion based on the determining; and use the BVP, with the componentadjusted to have the adjusted value, to determine or predict a blockvector (BV) for the current block.
 10. The apparatus of claim 9, whereinan upper bound of the range of values of the coordinate is adjustedbased on a width or height of the current block.
 11. The apparatus ofclaim 9, wherein the instructions that, when executed by the one or moreprocessors, cause the apparatus to adjust the component further causethe apparatus to adjust the component to have a value equal to a maximumor minimum value of the range of values.
 12. The apparatus of claim 9,wherein the instructions that, when executed by the one or moreprocessors, cause the apparatus to adjust the component further causethe apparatus to adjust the component to have a value equal to a closerone of a maximum or minimum value of the range of values.
 13. Theapparatus of claim 9, wherein the instructions that, when executed bythe one or more processors, cause the apparatus to adjust the componentfurther cause the apparatus to adjust the component to have a valueequal to a maximum value of the range of values based on the coordinateof the sample position being greater than an upper bound of the range ofvalues.
 14. The apparatus of claim 9, wherein the instructions that,when executed by the one or more processors, cause the apparatus toadjust the component further cause the apparatus to adjust the componentto have a value equal to a minimum value of the range of values based onthe coordinate of the sample position being less than a lower bound ofthe range of values.
 15. The apparatus of claim 9, wherein the directionof the coordinate is a horizontal direction.
 16. The apparatus of claim9, wherein the direction of the coordinate is a vertical direction. 17.A non-transitory computer-readable medium storing instructions that,when executed by one or more processors of an apparatus, cause theapparatus to: determine a value of a coordinate for a sample is outsidea range of values of the coordinate for samples in a reference region,wherein the sample is displaced relative to a current block by an amountindicated by a block vector predictor (BVP); adjust a component,corresponding to a direction of the coordinate, of the BVP to have anadjusted value closer to the range of values of the coordinate for thesamples in the reference region based on the determining; and use theBVP, with the component adjusted to have the adjusted value, todetermine or predict a block vector (BV) for the current block.
 18. Thenon-transitory computer-readable medium of claim 17, wherein an upperbound of the range of values of the coordinate is adjusted based on awidth or height of the current block.
 19. The non-transitorycomputer-readable medium of claim 17, wherein the instructions that,when executed by the one or more processors, cause the apparatus toadjust the component further cause the apparatus to adjust the componentto have a value equal to a maximum or minimum value of the range ofvalues.
 20. The non-transitory computer-readable medium of claim 17,wherein the instructions that, when executed by the one or moreprocessors, cause the apparatus to adjust the component further causethe apparatus to adjust the component to have a value equal to a closerone of a maximum or minimum value of the range of values.